#include "U_byte_change.h"

// 函数：将浮动数转换为字节并进行右移偏移
void append_float2u8(float num, char *buffer) {
    union FloatToBytes converter;
    converter.f = num;  // 将浮动数赋值给联合体的浮动数成员

    // 计算右移偏移后的字节顺序
    for (uint8_t i = 0; i < 4; i++) {
        buffer[i] = converter.bytes[i];  // 循环右移
    }
    // buffer[0] = converter.bytes[0];
    // buffer[1] = converter.bytes[1];
    // buffer[2] = converter.bytes[2];
    // buffer[3] = converter.bytes[3];
}


